package app.blog.service.filter;

import java.util.Comparator;

public abstract class Filter<T> implements Comparator<Filter<T>>{
	
	private int level = Integer.MAX_VALUE;
	
	public Filter(int level) {
		this.level = level;
	}
	
	@Override
	public int compare(Filter<T> o1, Filter<T> o2) {
		int delta = o1.level-o2.level;
		if(delta > 0){
			return 1;
		}else if(delta == 0){
			return 0;
		}else{
			return -1;
		}
	}
	
	public abstract boolean do_filter(T env);
	
}
